import request from "@/utils/request.ts";

export const getAnswer = async (question: string) => {
    try {

        let response: any = await request({
            method: "get",
            url: "/api/chat",
            params: {
                question
            }
        })
        console.log(response.data)
        if (response.code === 200) {
            console.log(response.data)
            return response.data;
        } else {
            throw new Error(response.message)
        }
    } catch (e) {
        console.log(e.message)
    }

}